package com.mjk.manager.monitor.model;

import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.ArcSharding;
import com.mjk.common.core.jdbc.annotation.Filed;
import com.mjk.common.core.jdbc.annotation.Id;
import lombok.Data;

/**
 * 服务节点类
 */
@Data
@ArcSharding(table = "service_node")
public class BeeServiceNodeModel extends BaseEntity {
    @Id
    @Filed(comment = "服务ID", lenght = 11)
    private Integer serviceId;

    @Filed(comment = "服务名称", lenght = 50)
    private String serviceName;

    @Filed(comment = "服务所在IP地址", lenght = 20)
    private String ip;

    @Filed(comment = "服务所在机器端口号", lenght = 10)
    private String port;

    @Filed(comment = "服务所在环境", lenght = 10)
    private String evnId;

    @Filed(comment = "服务是否可用", lenght = 10)
    private String enable;

    @Filed(comment = "服务元信息", lenght = 200)
    private String mateInfo;

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof BeeServiceNodeModel) {
            BeeServiceNodeModel person = (BeeServiceNodeModel) obj;
            return serviceId.equals(person.getServiceId());
        }
        return false;
    }
}
